package com.example.lib_core.mvvm;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

public abstract class BaseActivity<V extends ViewDataBinding,VM extends BaseViewModel> extends AppCompatActivity {
    protected V dataBinding;
    protected VM mViewModel;

    protected abstract int bandLayout();
    protected abstract void initData();
    protected abstract VM getViewModel();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mViewModel = getViewModel();
        dataBinding = DataBindingUtil.setContentView(this,bandLayout());
        initData();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
